﻿using System.IO;
using System.Xml;
using System.Xml.Serialization;

namespace Tumblr.API
{
    [XmlRoot("tumblr")]
    public class AccountInfo
    {
        public static AccountInfo Deserialize(XmlDocument xmlDocument)
        {
            if (xmlDocument != null)
            {
                var reader = new XmlNodeReader(xmlDocument.DocumentElement);
                var ser = new XmlSerializer(typeof(AccountInfo));
                return (AccountInfo)ser.Deserialize(reader);
            }

            return null;
        }

        [XmlElement("user")]
        public UserInfo User { get; set; }

        [XmlElement("tumblelog")]
        public TumbleLog TumbleLog { get; set; }
    }
}